/** @file               sw_rwlock.h
 *  @copyright          Copyright (C) 2006-2026 flyfish (tenggui_fu@126.com)
 *  @brief              This file is part of the swallow library
 *  @author             $Author: flyfish $
 *  @version            $Rev: 385 $
 *  @date               $Date: 2016-12-22 00:12:05 +0800 (周四, 22 12月 2016) $
 */
#ifndef __SW_RWLOCK_H__
#define __SW_RWLOCK_H__

typedef SW_VOID *SW_RWLOCK;
#define SW_INVALID_RWLOCK NULL

SW_API SW_RET SW_InitRWLockAPI(SW_VOID);
SW_API SW_RET SW_RunRWLockAPI(SW_VOID);
SW_API SW_RET SW_StopRWLockAPI(SW_VOID);
SW_API SW_RET SW_ExitRWLockAPI(SW_VOID);
SW_API SW_RWLOCK SW_CreateRWLock(SW_VOID);
SW_API SW_RET SW_DeleteRWLock(SW_RWLOCK rwlock);
SW_API SW_RET SW_LockRWLockRead(SW_RWLOCK rwlock);
SW_API SW_RET SW_TryLockRWLockRead(SW_RWLOCK rwlock);
SW_API SW_RET SW_TimeLockRWLockRead(SW_RWLOCK rwlock, SW_UINT32 msec);
SW_API SW_RET SW_UnlockRWLockRead(SW_RWLOCK rwlock);
SW_API SW_RET SW_LockRWLockWrite(SW_RWLOCK rwlock);
SW_API SW_RET SW_TryLockRWLockWrite(SW_RWLOCK rwlock);
SW_API SW_RET SW_TimeLockRWLockWrite(SW_RWLOCK rwlock, SW_UINT32 msec);
SW_API SW_RET SW_UnlockRWLockWrite(SW_RWLOCK rwlock);

#endif
